package com.imooc.long5zb.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.NotBlank;


@Data
@Document(collection = "user")
public class MongoUser {

    @Id
    private String id;

    @NotBlank
    private String name;

    @Range(min = 10, max = 120)
    private String age;

}
